ifeq ($(KERNELRELEASE),) 

CFLAGS := -Wdeclaration-after-statement
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd) 

.PHONY: build clean 

build:
	$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) modules

load:
	@for mod in $(obj-m); do \
		sudo insmod `basename $$mod .o`.ko; \
	done

clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c
else 

$(info Building with KERNELRELEASE = ${KERNELRELEASE})
obj-m := logcalls_sys.o 

endif

